package com.itheima04;


import java.util.ArrayList;
import java.util.Map;
import java.util.stream.Collectors;

public class Test02 {


    public static void main(String[] args) {
        ArrayList<String> s1 = new ArrayList<>();
        s1.add("zhangsan,21");
        s1.add("lisi,27");
        s1.add("wangwu,26");
        Map<String, Integer> map = s1.stream().filter(s -> {
            String[] split = s.split(",");
            int i = Integer.parseInt(split[1]);
            return i >= 23;
        }).collect(Collectors.toMap(
                s -> s.split(",")[0],
                s -> Integer.parseInt(s.split(",")[1])
        ));
        System.out.println("map = " + map);
    }
}
